package com.dd.cloud.common.annotate.validation;

import com.dd.cloud.common.annotate.validation.impl.CardValidation;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * 验证营业执照编号，纳税识别号，执业资格证编号，执业注册证编号，药材编号，采购单据编号、
 */
@Target({ElementType.METHOD, ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
@Constraint(validatedBy = CardValidation.class)
public @interface Card {

    boolean required() default true;

    /**
     * 提示语的开头,即替换message {begin}的内容
     * @return
     */
    String begin() default "";

    String message() default "{begin}内容格式为不超过30位的数字或英文字母";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}
